home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc-2.6.3-bin.lha / GNU / info / gcc.info-15 (.txt) < prev    next >
GNU Info File  |  1995-03-30  |  34KB  |  726 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation,
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License," "Funding for
  13. Free Software," and "Protect Your Freedom--Fight `Look And Feel'" are
  14. included exactly as in the original, and provided that the entire
  15. resulting derived work is distributed under the terms of a permission
  16. notice identical to this one.
  17.    Permission is granted to copy and distribute translations of this
  18. manual into another language, under the above conditions for modified
  19. versions, except that the sections entitled "GNU General Public
  20. License," "Funding for Free Software," and "Protect Your Freedom--Fight
  21. `Look And Feel'", and this permission notice, may be included in
  22. translations approved by the Free Software Foundation instead of in the
  23. original English.
  24. File: gcc.info,  Node: Output Statement,  Next: Constraints,  Prev: Output Template,  Up: Machine Desc
  25. C Statements for Assembler Output
  26. =================================
  27.    Often a single fixed template string cannot produce correct and
  28. efficient assembler code for all the cases that are recognized by a
  29. single instruction pattern.  For example, the opcodes may depend on the
  30. kinds of operands; or some unfortunate combinations of operands may
  31. require extra machine instructions.
  32.    If the output control string starts with a `@', then it is actually
  33. a series of templates, each on a separate line.  (Blank lines and
  34. leading spaces and tabs are ignored.)  The templates correspond to the
  35. pattern's constraint alternatives (*note Multi-Alternative::.).  For
  36. example, if a target machine has a two-address add instruction `addr'
  37. to add into a register and another `addm' to add a register to memory,
  38. you might write this pattern:
  39.      (define_insn "addsi3"
  40.        [(set (match_operand:SI 0 "general_operand" "=r,m")
  41.              (plus:SI (match_operand:SI 1 "general_operand" "0,0")
  42.                       (match_operand:SI 2 "general_operand" "g,r")))]
  43.        ""
  44.        "@
  45.         addr %2,%0
  46.         addm %2,%0")
  47.    If the output control string starts with a `*', then it is not an
  48. output template but rather a piece of C program that should compute a
  49. template.  It should execute a `return' statement to return the
  50. template-string you want.  Most such templates use C string literals,
  51. which require doublequote characters to delimit them.  To include these
  52. doublequote characters in the string, prefix each one with `\'.
  53.    The operands may be found in the array `operands', whose C data type
  54. is `rtx []'.
  55.    It is very common to select different ways of generating assembler
  56. code based on whether an immediate operand is within a certain range.
  57. Be careful when doing this, because the result of `INTVAL' is an
  58. integer on the host machine.  If the host machine has more bits in an
  59. `int' than the target machine has in the mode in which the constant
  60. will be used, then some of the bits you get from `INTVAL' will be
  61. superfluous.  For proper results, you must carefully disregard the
  62. values of those bits.
  63.    It is possible to output an assembler instruction and then go on to
  64. output or compute more of them, using the subroutine `output_asm_insn'.
  65. This receives two arguments: a template-string and a vector of
  66. operands.  The vector may be `operands', or it may be another array of
  67. `rtx' that you declare locally and initialize yourself.
  68.    When an insn pattern has multiple alternatives in its constraints,
  69. often the appearance of the assembler code is determined mostly by
  70. which alternative was matched.  When this is so, the C code can test
  71. the variable `which_alternative', which is the ordinal number of the
  72. alternative that was actually satisfied (0 for the first, 1 for the
  73. second alternative, etc.).
  74.    For example, suppose there are two opcodes for storing zero, `clrreg'
  75. for registers and `clrmem' for memory locations.  Here is how a pattern
  76. could use `which_alternative' to choose between them:
  77.      (define_insn ""
  78.        [(set (match_operand:SI 0 "general_operand" "=r,m")
  79.              (const_int 0))]
  80.        ""
  81.        "*
  82.        return (which_alternative == 0
  83.                ? \"clrreg %0\" : \"clrmem %0\");
  84.        ")
  85.    The example above, where the assembler code to generate was *solely*
  86. determined by the alternative, could also have been specified as
  87. follows, having the output control string start with a `@':
  88.      (define_insn ""
  89.        [(set (match_operand:SI 0 "general_operand" "=r,m")
  90.              (const_int 0))]
  91.        ""
  92.        "@
  93.         clrreg %0
  94.         clrmem %0")
  95. File: gcc.info,  Node: Constraints,  Next: Standard Names,  Prev: Output Statement,  Up: Machine Desc
  96. Operand Constraints
  97. ===================
  98.    Each `match_operand' in an instruction pattern can specify a
  99. constraint for the type of operands allowed.  Constraints can say
  100. whether an operand may be in a register, and which kinds of register;
  101. whether the operand can be a memory reference, and which kinds of
  102. address; whether the operand may be an immediate constant, and which
  103. possible values it may have.  Constraints can also require two operands
  104. to match.
  105. * Menu:
  106. * Simple Constraints::  Basic use of constraints.
  107. * Multi-Alternative::   When an insn has two alternative constraint-patterns.
  108. * Class Preferences::   Constraints guide which hard register to put things in.
  109. * Modifiers::           More precise control over effects of constraints.
  110. * Machine Constraints:: Existing constraints for some particular machines.
  111. * No Constraints::      Describing a clean machine without constraints.
  112. File: gcc.info,  Node: Simple Constraints,  Next: Multi-Alternative,  Up: Constraints
  113. Simple Constraints
  114. ------------------
  115.    The simplest kind of constraint is a string full of letters, each of
  116. which describes one kind of operand that is permitted.  Here are the
  117. letters that are allowed:
  118.      A memory operand is allowed, with any kind of address that the
  119.      machine supports in general.
  120.      A memory operand is allowed, but only if the address is
  121.      "offsettable".  This means that adding a small integer (actually,
  122.      the width in bytes of the operand, as determined by its machine
  123.      mode) may be added to the address and the result is also a valid
  124.      memory address.
  125.      For example, an address which is constant is offsettable; so is an
  126.      address that is the sum of a register and a constant (as long as a
  127.      slightly larger constant is also within the range of
  128.      address-offsets supported by the machine); but an autoincrement or
  129.      autodecrement address is not offsettable.  More complicated
  130.      indirect/indexed addresses may or may not be offsettable depending
  131.      on the other addressing modes that the machine supports.
  132.      Note that in an output operand which can be matched by another
  133.      operand, the constraint letter `o' is valid only when accompanied
  134.      by both `<' (if the target machine has predecrement addressing)
  135.      and `>' (if the target machine has preincrement addressing).
  136.      A memory operand that is not offsettable.  In other words,
  137.      anything that would fit the `m' constraint but not the `o'
  138.      constraint.
  139.      A memory operand with autodecrement addressing (either
  140.      predecrement or postdecrement) is allowed.
  141.      A memory operand with autoincrement addressing (either
  142.      preincrement or postincrement) is allowed.
  143.      A register operand is allowed provided that it is in a general
  144.      register.
  145. `d', `a', `f', ...
  146.      Other letters can be defined in machine-dependent fashion to stand
  147.      for particular classes of registers.  `d', `a' and `f' are defined
  148.      on the 68000/68020 to stand for data, address and floating point
  149.      registers.
  150.      An immediate integer operand (one with constant value) is allowed.
  151.      This includes symbolic constants whose values will be known only at
  152.      assembly time.
  153.      An immediate integer operand with a known numeric value is allowed.
  154.      Many systems cannot support assembly-time constants for operands
  155.      less than a word wide.  Constraints for these operands should use
  156.      `n' rather than `i'.
  157. `I', `J', `K', ... `P'
  158.      Other letters in the range `I' through `P' may be defined in a
  159.      machine-dependent fashion to permit immediate integer operands with
  160.      explicit integer values in specified ranges.  For example, on the
  161.      68000, `I' is defined to stand for the range of values 1 to 8.
  162.      This is the range permitted as a shift count in the shift
  163.      instructions.
  164.      An immediate floating operand (expression code `const_double') is
  165.      allowed, but only if the target floating point format is the same
  166.      as that of the host machine (on which the compiler is running).
  167.      An immediate floating operand (expression code `const_double') is
  168.      allowed.
  169. `G', `H'
  170.      `G' and `H' may be defined in a machine-dependent fashion to
  171.      permit immediate floating operands in particular ranges of values.
  172.      An immediate integer operand whose value is not an explicit
  173.      integer is allowed.
  174.      This might appear strange; if an insn allows a constant operand
  175.      with a value not known at compile time, it certainly must allow
  176.      any known value.  So why use `s' instead of `i'?  Sometimes it
  177.      allows better code to be generated.
  178.      For example, on the 68000 in a fullword instruction it is possible
  179.      to use an immediate operand; but if the immediate value is between
  180.      -128 and 127, better code results from loading the value into a
  181.      register and using the register.  This is because the load into
  182.      the register can be done with a `moveq' instruction.  We arrange
  183.      for this to happen by defining the letter `K' to mean "any integer
  184.      outside the range -128 to 127", and then specifying `Ks' in the
  185.      operand constraints.
  186.      Any register, memory or immediate integer operand is allowed,
  187.      except for registers that are not general registers.
  188.      Any operand whatsoever is allowed, even if it does not satisfy
  189.      `general_operand'.  This is normally used in the constraint of a
  190.      `match_scratch' when certain alternatives will not actually
  191.      require a scratch register.
  192. `0', `1', `2', ... `9'
  193.      An operand that matches the specified operand number is allowed.
  194.      If a digit is used together with letters within the same
  195.      alternative, the digit should come last.
  196.      This is called a "matching constraint" and what it really means is
  197.      that the assembler has only a single operand that fills two roles
  198.      considered separate in the RTL insn.  For example, an add insn has
  199.      two input operands and one output operand in the RTL, but on most
  200.      CISC machines an add instruction really has only two operands, one
  201.      of them an input-output operand:
  202.           addl #35,r12
  203.      Matching constraints are used in these circumstances.  More
  204.      precisely, the two operands that match must include one input-only
  205.      operand and one output-only operand.  Moreover, the digit must be a
  206.      smaller number than the number of the operand that uses it in the
  207.      constraint.
  208.      For operands to match in a particular case usually means that they
  209.      are identical-looking RTL expressions.  But in a few special cases
  210.      specific kinds of dissimilarity are allowed.  For example, `*x' as
  211.      an input operand will match `*x++' as an output operand.  For
  212.      proper results in such cases, the output template should always
  213.      use the output-operand's number when printing the operand.
  214.      An operand that is a valid memory address is allowed.  This is for
  215.      "load address" and "push address" instructions.
  216.      `p' in the constraint must be accompanied by `address_operand' as
  217.      the predicate in the `match_operand'.  This predicate interprets
  218.      the mode specified in the `match_operand' as the mode of the memory
  219.      reference for which the address would be valid.
  220. `Q', `R', `S', ... `U'
  221.      Letters in the range `Q' through `U' may be defined in a
  222.      machine-dependent fashion to stand for arbitrary operand types.
  223.      The machine description macro `EXTRA_CONSTRAINT' is passed the
  224.      operand as its first argument and the constraint letter as its
  225.      second operand.
  226.      A typical use for this would be to distinguish certain types of
  227.      memory references that affect other insn operands.
  228.      Do not define these constraint letters to accept register
  229.      references (`reg'); the reload pass does not expect this and would
  230.      not handle it properly.
  231.    In order to have valid assembler code, each operand must satisfy its
  232. constraint.  But a failure to do so does not prevent the pattern from
  233. applying to an insn.  Instead, it directs the compiler to modify the
  234. code so that the constraint will be satisfied.  Usually this is done by
  235. copying an operand into a register.
  236.    Contrast, therefore, the two instruction patterns that follow:
  237.      (define_insn ""
  238.        [(set (match_operand:SI 0 "general_operand" "=r")
  239.              (plus:SI (match_dup 0)
  240.                       (match_operand:SI 1 "general_operand" "r")))]
  241.        ""
  242.        "...")
  243. which has two operands, one of which must appear in two places, and
  244.      (define_insn ""
  245.        [(set (match_operand:SI 0 "general_operand" "=r")
  246.              (plus:SI (match_operand:SI 1 "general_operand" "0")
  247.                       (match_operand:SI 2 "general_operand" "r")))]
  248.        ""
  249.        "...")
  250. which has three operands, two of which are required by a constraint to
  251. be identical.  If we are considering an insn of the form
  252.      (insn N PREV NEXT
  253.        (set (reg:SI 3)
  254.             (plus:SI (reg:SI 6) (reg:SI 109)))
  255.        ...)
  256. the first pattern would not apply at all, because this insn does not
  257. contain two identical subexpressions in the right place.  The pattern
  258. would say, "That does not look like an add instruction; try other
  259. patterns." The second pattern would say, "Yes, that's an add
  260. instruction, but there is something wrong with it."  It would direct
  261. the reload pass of the compiler to generate additional insns to make
  262. the constraint true.  The results might look like this:
  263.      (insn N2 PREV N
  264.        (set (reg:SI 3) (reg:SI 6))
  265.        ...)
  266.      
  267.      (insn N N2 NEXT
  268.        (set (reg:SI 3)
  269.             (plus:SI (reg:SI 3) (reg:SI 109)))
  270.        ...)
  271.    It is up to you to make sure that each operand, in each pattern, has
  272. constraints that can handle any RTL expression that could be present for
  273. that operand.  (When multiple alternatives are in use, each pattern
  274. must, for each possible combination of operand expressions, have at
  275. least one alternative which can handle that combination of operands.)
  276. The constraints don't need to *allow* any possible operand--when this is
  277. the case, they do not constrain--but they must at least point the way to
  278. reloading any possible operand so that it will fit.
  279.    * If the constraint accepts whatever operands the predicate permits,
  280.      there is no problem: reloading is never necessary for this operand.
  281.      For example, an operand whose constraints permit everything except
  282.      registers is safe provided its predicate rejects registers.
  283.      An operand whose predicate accepts only constant values is safe
  284.      provided its constraints include the letter `i'.  If any possible
  285.      constant value is accepted, then nothing less than `i' will do; if
  286.      the predicate is more selective, then the constraints may also be
  287.      more selective.
  288.    * Any operand expression can be reloaded by copying it into a
  289.      register.  So if an operand's constraints allow some kind of
  290.      register, it is certain to be safe.  It need not permit all
  291.      classes of registers; the compiler knows how to copy a register
  292.      into another register of the proper class in order to make an
  293.      instruction valid.
  294.    * A nonoffsettable memory reference can be reloaded by copying the
  295.      address into a register.  So if the constraint uses the letter
  296.      `o', all memory references are taken care of.
  297.    * A constant operand can be reloaded by allocating space in memory to
  298.      hold it as preinitialized data.  Then the memory reference can be
  299.      used in place of the constant.  So if the constraint uses the
  300.      letters `o' or `m', constant operands are not a problem.
  301.    * If the constraint permits a constant and a pseudo register used in
  302.      an insn was not allocated to a hard register and is equivalent to
  303.      a constant, the register will be replaced with the constant.  If
  304.      the predicate does not permit a constant and the insn is
  305.      re-recognized for some reason, the compiler will crash.  Thus the
  306.      predicate must always recognize any objects allowed by the
  307.      constraint.
  308.    If the operand's predicate can recognize registers, but the
  309. constraint does not permit them, it can make the compiler crash.  When
  310. this operand happens to be a register, the reload pass will be stymied,
  311. because it does not know how to copy a register temporarily into memory.
  312. File: gcc.info,  Node: Multi-Alternative,  Next: Class Preferences,  Prev: Simple Constraints,  Up: Constraints
  313. Multiple Alternative Constraints
  314. --------------------------------
  315.    Sometimes a single instruction has multiple alternative sets of
  316. possible operands.  For example, on the 68000, a logical-or instruction
  317. can combine register or an immediate value into memory, or it can
  318. combine any kind of operand into a register; but it cannot combine one
  319. memory location into another.
  320.    These constraints are represented as multiple alternatives.  An
  321. alternative can be described by a series of letters for each operand.
  322. The overall constraint for an operand is made from the letters for this
  323. operand from the first alternative, a comma, the letters for this
  324. operand from the second alternative, a comma, and so on until the last
  325. alternative.  Here is how it is done for fullword logical-or on the
  326. 68000:
  327.      (define_insn "iorsi3"
  328.        [(set (match_operand:SI 0 "general_operand" "=m,d")
  329.              (ior:SI (match_operand:SI 1 "general_operand" "%0,0")
  330.                      (match_operand:SI 2 "general_operand" "dKs,dmKs")))]
  331.        ...)
  332.    The first alternative has `m' (memory) for operand 0, `0' for
  333. operand 1 (meaning it must match operand 0), and `dKs' for operand 2.
  334. The second alternative has `d' (data register) for operand 0, `0' for
  335. operand 1, and `dmKs' for operand 2.  The `=' and `%' in the
  336. constraints apply to all the alternatives; their meaning is explained
  337. in the next section (*note Class Preferences::.).
  338.    If all the operands fit any one alternative, the instruction is
  339. valid.  Otherwise, for each alternative, the compiler counts how many
  340. instructions must be added to copy the operands so that that
  341. alternative applies.  The alternative requiring the least copying is
  342. chosen.  If two alternatives need the same amount of copying, the one
  343. that comes first is chosen.  These choices can be altered with the `?'
  344. and `!' characters:
  345.      Disparage slightly the alternative that the `?' appears in, as a
  346.      choice when no alternative applies exactly.  The compiler regards
  347.      this alternative as one unit more costly for each `?' that appears
  348.      in it.
  349.      Disparage severely the alternative that the `!' appears in.  This
  350.      alternative can still be used if it fits without reloading, but if
  351.      reloading is needed, some other alternative will be used.
  352.    When an insn pattern has multiple alternatives in its constraints,
  353. often the appearance of the assembler code is determined mostly by which
  354. alternative was matched.  When this is so, the C code for writing the
  355. assembler code can use the variable `which_alternative', which is the
  356. ordinal number of the alternative that was actually satisfied (0 for
  357. the first, 1 for the second alternative, etc.).  *Note Output
  358. Statement::.
  359. File: gcc.info,  Node: Class Preferences,  Next: Modifiers,  Prev: Multi-Alternative,  Up: Constraints
  360. Register Class Preferences
  361. --------------------------
  362.    The operand constraints have another function: they enable the
  363. compiler to decide which kind of hardware register a pseudo register is
  364. best allocated to.  The compiler examines the constraints that apply to
  365. the insns that use the pseudo register, looking for the
  366. machine-dependent letters such as `d' and `a' that specify classes of
  367. registers.  The pseudo register is put in whichever class gets the most
  368. "votes".  The constraint letters `g' and `r' also vote: they vote in
  369. favor of a general register.  The machine description says which
  370. registers are considered general.
  371.    Of course, on some machines all registers are equivalent, and no
  372. register classes are defined.  Then none of this complexity is relevant.
  373. File: gcc.info,  Node: Modifiers,  Next: Machine Constraints,  Prev: Class Preferences,  Up: Constraints
  374. Constraint Modifier Characters
  375. ------------------------------
  376.    Here are constraint modifier characters.
  377.      Means that this operand is write-only for this instruction: the
  378.      previous value is discarded and replaced by output data.
  379.      Means that this operand is both read and written by the
  380.      instruction.
  381.      When the compiler fixes up the operands to satisfy the constraints,
  382.      it needs to know which operands are inputs to the instruction and
  383.      which are outputs from it.  `=' identifies an output; `+'
  384.      identifies an operand that is both input and output; all other
  385.      operands are assumed to be input only.
  386.      Means (in a particular alternative) that this operand is written
  387.      before the instruction is finished using the input operands.
  388.      Therefore, this operand may not lie in a register that is used as
  389.      an input operand or as part of any memory address.
  390.      `&' applies only to the alternative in which it is written.  In
  391.      constraints with multiple alternatives, sometimes one alternative
  392.      requires `&' while others do not.  See, for example, the `movdf'
  393.      insn of the 68000.
  394.      `&' does not obviate the need to write `='.
  395.      Declares the instruction to be commutative for this operand and the
  396.      following operand.  This means that the compiler may interchange
  397.      the two operands if that is the cheapest way to make all operands
  398.      fit the constraints.  This is often used in patterns for addition
  399.      instructions that really have only two operands: the result must
  400.      go in one of the arguments.  Here for example, is how the 68000
  401.      halfword-add instruction is defined:
  402.           (define_insn "addhi3"
  403.             [(set (match_operand:HI 0 "general_operand" "=m,r")
  404.                (plus:HI (match_operand:HI 1 "general_operand" "%0,0")
  405.                         (match_operand:HI 2 "general_operand" "di,g")))]
  406.             ...)
  407.      Says that all following characters, up to the next comma, are to be
  408.      ignored as a constraint.  They are significant only for choosing
  409.      register preferences.
  410.      Says that the following character should be ignored when choosing
  411.      register preferences.  `*' has no effect on the meaning of the
  412.      constraint as a constraint, and no effect on reloading.
  413.      Here is an example: the 68000 has an instruction to sign-extend a
  414.      halfword in a data register, and can also sign-extend a value by
  415.      copying it into an address register.  While either kind of
  416.      register is acceptable, the constraints on an address-register
  417.      destination are less strict, so it is best if register allocation
  418.      makes an address register its goal.  Therefore, `*' is used so
  419.      that the `d' constraint letter (for data register) is ignored when
  420.      computing register preferences.
  421.           (define_insn "extendhisi2"
  422.             [(set (match_operand:SI 0 "general_operand" "=*d,a")
  423.                   (sign_extend:SI
  424.                    (match_operand:HI 1 "general_operand" "0,g")))]
  425.             ...)
  426. File: gcc.info,  Node: Machine Constraints,  Next: No Constraints,  Prev: Modifiers,  Up: Constraints
  427. Constraints for Particular Machines
  428. -----------------------------------
  429.    Whenever possible, you should use the general-purpose constraint
  430. letters in `asm' arguments, since they will convey meaning more readily
  431. to people reading your code.  Failing that, use the constraint letters
  432. that usually have very similar meanings across architectures.  The most
  433. commonly used constraints are `m' and `r' (for memory and
  434. general-purpose registers respectively; *note Simple Constraints::.),
  435. and `I', usually the letter indicating the most common
  436. immediate-constant format.
  437.    For each machine architecture, the `config/MACHINE.h' file defines
  438. additional constraints.  These constraints are used by the compiler
  439. itself for instruction generation, as well as for `asm' statements;
  440. therefore, some of the constraints are not particularly interesting for
  441. `asm'.  The constraints are defined through these macros:
  442. `REG_CLASS_FROM_LETTER'
  443.      Register class constraints (usually lower case).
  444. `CONST_OK_FOR_LETTER_P'
  445.      Immediate constant constraints, for non-floating point constants of
  446.      word size or smaller precision (usually upper case).
  447. `CONST_DOUBLE_OK_FOR_LETTER_P'
  448.      Immediate constant constraints, for all floating point constants
  449.      and for constants of greater than word size precision (usually
  450.      upper case).
  451. `EXTRA_CONSTRAINT'
  452.      Special cases of registers or memory.  This macro is not required,
  453.      and is only defined for some machines.
  454.    Inspecting these macro definitions in the compiler source for your
  455. machine is the best way to be certain you have the right constraints.
  456. However, here is a summary of the machine-dependent constraints
  457. available on some particular machines.
  458. *ARM family--`arm.h'*
  459.     `f'
  460.           Floating-point register
  461.     `F'
  462.           One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0,
  463.           4.0, 5.0 or 10.0
  464.     `G'
  465.           Floating-point constant that would satisfy the constraint `F'
  466.           if it were negated
  467.     `I'
  468.           Integer that is valid as an immediate operand in a data
  469.           processing instruction.  That is, an integer in the range 0
  470.           to 255 rotated by a multiple of 2
  471.     `J'
  472.           Integer in the range -4095 to 4095
  473.     `K'
  474.           Integer that satisfies constraint `I' when inverted (ones
  475.           complement)
  476.     `L'
  477.           Integer that satisfies constraint `I' when negated (twos
  478.           complement)
  479.     `M'
  480.           Integer in the range 0 to 32
  481.     `Q'
  482.           A memory reference where the exact address is in a single
  483.           register (``m'' is preferable for `asm' statements)
  484.     `R'
  485.           An item in the constant pool
  486.     `S'
  487.           A symbol in the text segment of the current file
  488. *AMD 29000 family--`a29k.h'*
  489.     `l'
  490.           Local register 0
  491.     `b'
  492.           Byte Pointer (`BP') register
  493.     `q'
  494.           `Q' register
  495.     `h'
  496.           Special purpose register
  497.     `A'
  498.           First accumulator register
  499.     `a'
  500.           Other accumulator register
  501.     `f'
  502.           Floating point register
  503.     `I'
  504.           Constant greater than 0, less than 0x100
  505.     `J'
  506.           Constant greater than 0, less than 0x10000
  507.     `K'
  508.           Constant whose high 24 bits are on (1)
  509.     `L'
  510.           16 bit constant whose high 8 bits are on (1)
  511.     `M'
  512.           32 bit constant whose high 16 bits are on (1)
  513.     `N'
  514.           32 bit negative constant that fits in 8 bits
  515.     `O'
  516.           The constant 0x80000000 or, on the 29050, any 32 bit constant
  517.           whose low 16 bits are 0.
  518.     `P'
  519.           16 bit negative constant that fits in 8 bits
  520.     `G'
  521.     `H'
  522.           A floating point constant (in `asm' statements, use the
  523.           machine independent `E' or `F' instead)
  524. *IBM RS6000--`rs6000.h'*
  525.     `b'
  526.           Address base register
  527.     `f'
  528.           Floating point register
  529.     `h'
  530.           `MQ', `CTR', or `LINK' register
  531.     `q'
  532.           `MQ' register
  533.     `c'
  534.           `CTR' register
  535.     `l'
  536.           `LINK' register
  537.     `x'
  538.           `CR' register (condition register) number 0
  539.     `y'
  540.           `CR' register (condition register)
  541.     `I'
  542.           Signed 16 bit constant
  543.     `J'
  544.           Constant whose low 16 bits are 0
  545.     `K'
  546.           Constant whose high 16 bits are 0
  547.     `L'
  548.           Constant suitable as a mask operand
  549.     `M'
  550.           Constant larger than 31
  551.     `N'
  552.           Exact power of 2
  553.     `O'
  554.           Zero
  555.     `P'
  556.           Constant whose negation is a signed 16 bit constant
  557.     `G'
  558.           Floating point constant that can be loaded into a register
  559.           with one instruction per word
  560.     `Q'
  561.           Memory operand that is an offset from a register (`m' is
  562.           preferable for `asm' statements)
  563. *Intel 386--`i386.h'*
  564.     `q'
  565.           `a', `b', `c', or `d' register
  566.     `A'
  567.           `a', or `d' register (for 64-bit ints)
  568.     `f'
  569.           Floating point register
  570.     `t'
  571.           First (top of stack) floating point register
  572.     `u'
  573.           Second floating point register
  574.     `a'
  575.           `a' register
  576.     `b'
  577.           `b' register
  578.     `c'
  579.           `c' register
  580.     `d'
  581.           `d' register
  582.     `D'
  583.           `di' register
  584.     `S'
  585.           `si' register
  586.     `I'
  587.           Constant in range 0 to 31 (for 32 bit shifts)
  588.     `J'
  589.           Constant in range 0 to 63 (for 64 bit shifts)
  590.     `K'
  591.           `0xff'
  592.     `L'
  593.           `0xffff'
  594.     `M'
  595.           0, 1, 2, or 3 (shifts for `lea' instruction)
  596.     `G'
  597.           Standard 80387 floating point constant
  598. *Intel 960--`i960.h'*
  599.     `f'
  600.           Floating point register (`fp0' to `fp3')
  601.     `l'
  602.           Local register (`r0' to `r15')
  603.     `b'
  604.           Global register (`g0' to `g15')
  605.     `d'
  606.           Any local or global register
  607.     `I'
  608.           Integers from 0 to 31
  609.     `J'
  610.           0
  611.     `K'
  612.           Integers from -31 to 0
  613.     `G'
  614.           Floating point 0
  615.     `H'
  616.           Floating point 1
  617. *MIPS--`mips.h'*
  618.     `d'
  619.           General-purpose integer register
  620.     `f'
  621.           Floating-point register (if available)
  622.     `h'
  623.           `Hi' register
  624.     `l'
  625.           `Lo' register
  626.     `x'
  627.           `Hi' or `Lo' register
  628.     `y'
  629.           General-purpose integer register
  630.     `z'
  631.           Floating-point status register
  632.     `I'
  633.           Signed 16 bit constant (for arithmetic instructions)
  634.     `J'
  635.           Zero
  636.     `K'
  637.           Zero-extended 16-bit constant (for logic instructions)
  638.     `L'
  639.           Constant with low 16 bits zero (can be loaded with `lui')
  640.     `M'
  641.           32 bit constant which requires two instructions to load (a
  642.           constant which is not `I', `K', or `L')
  643.     `N'
  644.           Negative 16 bit constant
  645.     `O'
  646.           Exact power of two
  647.     `P'
  648.           Positive 16 bit constant
  649.     `G'
  650.           Floating point zero
  651.     `Q'
  652.           Memory reference that can be loaded with more than one
  653.           instruction (`m' is preferable for `asm' statements)
  654.     `R'
  655.           Memory reference that can be loaded with one instruction (`m'
  656.           is preferable for `asm' statements)
  657.     `S'
  658.           Memory reference in external OSF/rose PIC format (`m' is
  659.           preferable for `asm' statements)
  660. *Motorola 680x0--`m68k.h'*
  661.     `a'
  662.           Address register
  663.     `d'
  664.           Data register
  665.     `f'
  666.           68881 floating-point register, if available
  667.     `x'
  668.           Sun FPA (floating-point) register, if available
  669.     `y'
  670.           First 16 Sun FPA registers, if available
  671.     `I'
  672.           Integer in the range 1 to 8
  673.     `J'
  674.           16 bit signed number
  675.     `K'
  676.           Signed number whose magnitude is greater than 0x80
  677.     `L'
  678.           Integer in the range -8 to -1
  679.     `G'
  680.           Floating point constant that is not a 68881 constant
  681.     `H'
  682.           Floating point constant that can be used by Sun FPA
  683. *SPARC--`sparc.h'*
  684.     `f'
  685.           Floating-point register
  686.     `I'
  687.           Signed 13 bit constant
  688.     `J'
  689.           Zero
  690.     `K'
  691.           32 bit constant with the low 12 bits clear (a constant that
  692.           can be loaded with the `sethi' instruction)
  693.     `G'
  694.           Floating-point zero
  695.     `H'
  696.           Signed 13 bit constant, sign-extended to 32 or 64 bits
  697.     `Q'
  698.           Memory reference that can be loaded with one instruction
  699.           (`m' is more appropriate for `asm' statements)
  700.     `S'
  701.           Constant, or memory address
  702.     `T'
  703.           Memory address aligned to an 8-byte boundary
  704.     `U'
  705.           Even register
  706. File: gcc.info,  Node: No Constraints,  Prev: Machine Constraints,  Up: Constraints
  707. Not Using Constraints
  708. ---------------------
  709.    Some machines are so clean that operand constraints are not
  710. required.  For example, on the Vax, an operand valid in one context is
  711. valid in any other context.  On such a machine, every operand
  712. constraint would be `g', excepting only operands of "load address"
  713. instructions which are written as if they referred to a memory
  714. location's contents but actual refer to its address.  They would have
  715. constraint `p'.
  716.    For such machines, instead of writing `g' and `p' for all the
  717. constraints, you can choose to write a description with empty
  718. constraints.  Then you write `""' for the constraint in every
  719. `match_operand'.  Address operands are identified by writing an
  720. `address' expression around the `match_operand', not by their
  721. constraints.
  722.    When the machine description has just empty constraints, certain
  723. parts of compilation are skipped, making the compiler faster.  However,
  724. few machines actually do not need constraints; all machine descriptions
  725. now in existence use constraints.
  726.